package com.tencet.servlet;

import com.tencet.service.Impl.WithdrawalImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: @date: 2022/7/21 15:08
 * @description:
 */
@WebServlet("/withdrawal1")
public class WithdrawalServlet1 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //String money1 = req.getParameter("money");

        int money = Integer.parseInt(req.getParameter("money"));
        String card2_num = (String)req.getSession().getAttribute("card2_num");
        req.getSession().setAttribute("money",money);
        WithdrawalImpl wa = new WithdrawalImpl();
        boolean b = wa.trueOrFalse(money, card2_num);
        resp.getWriter().write(""+b);
    }
}